Skip to content

Bump go-safecast to v2.0.0 closes #23#24

Merged
dehanj merged 1 commit intotillitis:mainfrom
jas4711:safecastv2
Dec 11, 2025
Merged

Bump go-safecast to v2.0.0 closes #23#24
dehanj merged 1 commit intotillitis:mainfrom
jas4711:safecastv2

Conversation

@jas4711
Copy link
Contributor

@jas4711 jas4711 commented Dec 7, 2025

As used by Debian packaging - should be ready for merge, see review below

@jas4711 jas4711 changed the title Bump go-safecast to v2.0.0 closes #4 Bump go-safecast to v2.0.0 closes #23 Dec 7, 2025
@jas4711 jas4711 force-pushed the safecastv2 branch 2 times, most recently from 0089582 to b078fe3 Compare December 7, 2025 10:36
@jas4711
Copy link
Contributor Author

jas4711 commented Dec 7, 2025

The b078fe3 commit was uploaded to Debian experimental, so we get things to build in Debian with go-safecast v2. I'm not sure how to test the patch, I'll get to updating binaries eventually, and maybe find my tkey somewhere for testing...

@jas4711
Copy link
Contributor Author

jas4711 commented Dec 10, 2025

@ccoVeille could you review if this makes sense from a go-safecast API point of view?

go.mod Outdated

require (
github.com/ccoveille/go-safecast v1.1.0
github.com/ccoveille/go-safecast v2.0.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have an issue here, it should be something like this

Suggested change
github.com/ccoveille/go-safecast v2.0.0
github.com/ccoveille/go-safecast/v2 v2.0.0

So to make sure everything is fine:

  • remove the line here
  • run go mod tidy
  • run go get -u github.com/ccoveille/go-safecast/v2
  • run go mod tidy
  • commit again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Better now?

Debian build system doesn't look at go.mod, so verifying if things works or not was a bit hard for me.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait for someone to start the CI to know if it's OK. But otherwise LGTM 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for review @ccoVeille - just to confirm, does the actual API changes looks correct to you? Getting int conversion wrong here may be have rather bad consequences for this code, so the more eyes can check it the better. I'll see if I somehow can confirm using a real physical Tillitis key that applications linked to this library still works properly.

Copy link

@ccoVeille ccoVeille Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had also reviewed the changes you did, no worries.

I can affirm the ToUintX replaced by Convert [uintX] are all OK.

And than the code behind v1 and v2 is identical and fully tested in my package. I only changed the methods to use.

So the changes are safe in term of code, but of course a full test made by someone with a key would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splendid, thank you! Over to upstream...

Closes tillitis#23

Signed-off-by: Simon Josefsson <simon@josefsson.org>
@dehanj dehanj self-requested a review December 11, 2025 08:37
@dehanj dehanj linked an issue Dec 11, 2025 that may be closed by this pull request
Copy link
Member

@dehanj dehanj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, tested with real hardware.

Thanks for the help migrating, appreciate it!

@dehanj dehanj merged commit 145eccf into tillitis:main Dec 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump github.com/ccoveille/go-safecast to v2?

3 participants